//
//  BVAddNewAddressViewController.m
//  BuyVegetable
//
//  Created by yushanchang on 16/10/7.
//  Copyright © 2016年 com.yinding. All rights reserved.
//

#import "BVAddNewAddressViewController.h"
#import "BVPopAddNewAddressView.h"
#import "KLCPopup.h"

@interface BVAddNewAddressViewController ()
@property (nonatomic, strong) BVPopAddNewAddressView *popAddNewAddress;
@property (nonatomic, strong) KLCPopup *popup;
@end

@implementation BVAddNewAddressViewController

- (IBAction)searchClick:(id)sender {
    [self.popup showWithLayout:KLCPopupLayoutMake(KLCPopupHorizontalLayoutCenter, KLCPopupVerticalLayoutBottom)];
}

- (void)viewDidLoad {
    [super viewDidLoad];
    [self.navigationItem setTitle:@"新增自提地点"];
}

- (KLCPopup *)popup {
    if (!_popup) {
        _popup = [KLCPopup popupWithContentView:self.popAddNewAddress showType:KLCPopupShowTypeSlideInFromBottom dismissType:KLCPopupDismissTypeSlideOutToBottom maskType:KLCPopupMaskTypeDimmed dismissOnBackgroundTouch:YES dismissOnContentTouch:NO];
        _popup.visualEffect = NO;
    }
    return _popup;
}

- (BVPopAddNewAddressView *)popAddNewAddress {
    if (!_popAddNewAddress) {
        _popAddNewAddress = [BVPopAddNewAddressView initWithOwner:self];
        _popAddNewAddress.frame = CGRectMake(0, 0, ScreenW, 170);
        __weak BVAddNewAddressViewController *weakSelf = self;
        _popAddNewAddress.cancelBlock = ^{
            [weakSelf.popup dismiss:YES];
        };
    }
    return _popAddNewAddress;
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
}

@end
